package processing_layer;

/**
 * This class represents an entry in the DB courses table.
 * It is used in order to pass information from the DB layer to the interface layer,
 * and avoiding the excess usage of ResultSets 
 */
public class Course
{
	public String name;
	public String description;
	public float creditPoints;
	public int capacity;
	public int registered;
	public int groupNumber;
	public String courseCreator;
	
	public Course(String name, String description, float creditPoints,
			      int capacity, int registered, int groupNumber, String courseCreator)
	{
		super();
		this.name = name;
		this.description = description;
		this.creditPoints = creditPoints;
		this.capacity = capacity;
		this.registered = registered;
		this.groupNumber = groupNumber;
		this.courseCreator = courseCreator;
	}
	
	public boolean equals(Object comparable)
	{
		if (this == comparable)
		{
			return true;
		}
		
		if (null == comparable)
		{
			return false;
		}
		
		if (this.getClass() != comparable.getClass())
		{
			return false;
		}
		
		final Course tempContainer = (Course) comparable;
		
		if (!this.name.equals(tempContainer.name))
		{
			return false;
		}
		return true;
	}
}
